<template>
	<view class="page" v-if="isRender">
		<view class="page__bd">
			<view class="good-detail">
				<u-swiper height="750" border-radius="0" indicator-pos="topRight" img-mode="aspectFill"
					:list="info.images_array"></u-swiper>
				<view class="section info">
					<view class="share"></view>
					<view class="title">{{info.title}}</view>
					<view class="desc">{{info.description}}</view>
					<view class="bottom">
						<view class="score">{{info.score}}积分</view>
						<view class="sale">已兑{{info.ficti_sales}}</view>
					</view>
				</view>
				<view class="section content u-m-t-50">
					<view class="title u-p-b-30">产品详情</view>
					<u-parse :html="info.content"></u-parse>
				</view>
			</view>
		</view>
		<view class="page__ft">
			<view class="oper">
				<u-button type="primary" open-type="contact">
					<u-icon name="chat" size="46"></u-icon>
				</u-button>
				<u-button type="success" @click="navTo('/pages/scoreshop/good/exchange',{id:info.id})"
					class="btn-submit">立即兑换</u-button>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				info: null,
				isRender: false
			}
		},
		onLoad(options) {
			let that = this;
			this.$u.api.getScoreshopGoodDetail({
				id: options.id
			}).then(res => {
				that.info = res.data;
				that.isRender = true;
			});
			setTimeout(() => {
				this.loading = false;
			}, 2000)
		},
		onShareAppMessage(res) {
			return {
				title: this.info.title
			}
		},
		onShareTimeline() {
			return {
				title: this.info.title
			}
		},
		methods: {
		}
	}
</script>

<style>
	page {
		background-color: #f4f4f4;
	}

	.page {
		// #ifdef H5
		height: calc(100vh - 44px);
		// #endif

		// #ifdef MP-WEIXIN
		height: 100vh;
		// #endif
	}

	.page__bd {
		padding-bottom: 30rpx;
	}

	.page__ft {
		flex-shrink: 0;
		padding-top: 30rpx;
		padding-bottom: 30rpx;
	}

	.section {

		background-color: #ffffff;
		border-radius: 30rpx;
		padding: 50rpx 30rpx;
		width: calc(100% - 100rpx);
		margin-left: auto;
		margin-right: auto;
		box-shadow: 4px 4px 10px #e0e0e0;
	}

	.info {
		position: relative;
		z-index: 100;
		margin-top: -50rpx;
	}

	.info .title {
		font-size: 32rpx;
		font-weight: 600;
		margin-bottom: 10rpx;
	}

	.info .desc {
		border-bottom: 1rpx solid #eeeeee;
		padding-bottom: 30rpx;
		color: #666666;
	}

	.bottom {
		padding-top: 30rpx;
		display: flex;
		align-items: center;
	}

	.bottom .score {
		font-size: 36rpx;
		font-weight: 600;
		color: #59ba9c
	}

	.bottom .sale {
		font-size: 24rpx;
		color: #666666;
		margin-left: 20rpx;
	}

	.oper {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.oper .u-btn {
		margin-left: 10rpx;
		margin-right: 10rpx;
	}

	.btn-submit {
		width: 350rpx;
	}

	.content .title {
		font-weight: 600;
		font-size: 40rpx;
	}
</style>
